import api from "./index";
import { axios } from "@/utils/request";
import Qs from "qs";

// export function sexAnalysis(parameter) {
//   return axios({
//     url: api.SexAnalysis,
//     method: 'get',
//     params: parameter
//   })
// }
// export function analysis(parameter1, parameter2) {
//     return axios({
//       url: `${api.Analysis}?name=${parameter1}`,
//       method: 'post',
//       data: parameter2
//     })
//   }
export function exportElectricityBill (parameter) {
  return axios({
    url: '/Export/ExportElectricityBill',
    method: 'get',
    params: parameter
  })
}
export function exportWaterBill (parameter) {
  return axios({
    url: '/Export/ExportWaterBill',
    method: 'get',
    params: parameter
  })
}
export function exportRentBill (parameter) {
  return axios({
    url: '/Export/ExportRentBill',
    method: 'get',
    params: parameter
  })
}
export function getContractList (parameter) {
  return axios({
    url: "/Contract/GetList",
    method: "get",
    params: parameter,
  });
}
export function auditRentBill (parameter) {
  return axios({
    url: "/RentBill/Audit",
    method: "post",
    data: parameter,
  });
}

export function auditWaterBill (parameter) {
  return axios({
    url: "/WaterBill/Audit",
    method: "post",
    data: parameter,
  });
}

export function auditElectricityBill (parameter) {
  return axios({
    url: "/ElectricityBill/Audit",
    method: "post",
    data: parameter,
  });
}
//电费批量付款
export function batchPaymentElectricity (parameter) {
  return axios({
    url: "/ElectricityBill/BatchPayment",
    method: "post",
    data: parameter,
  });
}
//水费批量付款
export function batchPaymentWater (parameter) {
  return axios({
    url: "/WaterBill/BatchPayment",
    method: "post",
    data: parameter,
  });
}
//房租批量付款
export function batchPaymentRent (parameter) {
  return axios({
    url: "/RentBill/BatchPayment",
    method: "post",
    data: parameter,
  });
}
// 获取租赁列表
export function getLeasedPersonnelList (parameter) {
  return axios({
    url: "/LeasedPersonnel/GetList",
    method: "get",
    params: parameter,
  });
}
// 获取租赁列表
export function getContractGetTenantList (parameter) {
  return axios({
    url: "/Contract/GetTenantList",
    method: "get",
    params: parameter,
  });
}
export function deleteLeasedPersonnelByIds (parameter) {
  return axios({
    url: "/LeasedPersonnel/DeleteByIds",
    method: "post",
    data: parameter,
  });
}
export function SetContractState (parameter) {
  return axios({
    url: "/Contract/SetState",
    method: "post",
    data: parameter,
  });
}
export function getLeasedPersonnelByID (parameter) {
  return axios({
    url: "/LeasedPersonnel/GetLeasedPersonnelByID",
    method: "get",
    params: parameter,
  });
}

export function getContractByID (parameter) {
  return axios({
    url: "/Contract/GetContractByID",
    method: "get",
    params: parameter,
  });
}
export function buildContractBills (parameter) {
  return axios({
    url: "/Contract/BuildContractBills",
    method: "get",
    params: parameter,
  });
}
export function getUnitPriceList (parameter) {
  return axios({
    url: "/WaterElectricityUnitPrice/GetList",
    method: "get",
    params: parameter,
  });
}
export function deleteContract (parameter) {
  return axios({
    url: "/Contract/DeleteByIds",
    method: "post",
    data: parameter,
  });
}


export function GetWaterBillList (parameter) {
  return axios({
    url: "/WaterBill/GetListByOpenid",
    method: "get",
    params: parameter,
  });
}

export function getWaterBillByID (parameter) {
  return axios({
    url: "/WaterBill/GetWaterBillByID",
    method: "get",
    params: parameter,
  });
}

export function saveWaterBill (parameter) {
  return axios({
    url: `/WaterBill/SaveWaterBill`,
    method: "post",
    data: parameter,
  });
}


export function paymentWaterBill (parameter) {
  return axios({
    url: `/WaterBill/OfflinePayment`,
    method: "post",
    data: parameter,
  });
}
export function paymentElectricityBill (parameter) {
  return axios({
    url: `/ElectricityBill/OfflinePayment`,
    method: "post",
    data: parameter,
  });
}
export function paymentRentBill (parameter) {
  return axios({
    url: `/RentBill/OfflinePayment`,
    method: "post",
    data: parameter,
  });
}

export function saveContract (parameter) {
  return axios({
    url: `/Contract/SaveContract`,
    method: "post",
    data: parameter,
  });
}
export function deleteWaterBillByIds (parameter) {
  return axios({
    url: `/WaterBill/DeleteByIds`,
    method: "post",
    data: parameter,
  });
}
export function deleteElectricityBillByIds (parameter) {
  return axios({
    url: `/ElectricityBill/DeleteByIds`,
    method: "post",
    data: parameter,
  });
}
export function getElectricityBillList (parameter) {
  return axios({
    url: "/ElectricityBill/GetListByOpenid",
    method: "get",
    params: parameter,
  });
}


export function getElectricityBillByID (parameter) {
  return axios({
    url: "/ElectricityBill/GetElectricityBillByID",
    method: "get",
    params: parameter,
  });
}
// 房租账单
export function getRentBillList (parameter) {
  return axios({
    url: "/RentBill/GetList",
    method: "get",
    params: parameter,
  });
}


export function getRentBillByID (parameter) {
  return axios({
    url: "/RentBill/GetRentBillByID",
    method: "get",
    params: parameter,
  });
}

export function delRentBillByID (parameter) {
  return axios({
    url: "/RentBill/DeleteByIds",
    method: "post",
    data: parameter,
  });
}
// 房间部分
// 获取房间列表
export function getRoomList (parameter) {
  return axios({
    url: "/Room/GetList",
    method: "get",
    params: parameter,
  });
}
// 房间部分
// 获取房间列表
export function getBuildingTree (parameter) {
  return axios({
    url: "/ResidentialArea/GetBuildingTree",
    method: "get",
    params: parameter,
  });
}
// 获取房间详情
export function getRoomByID (parameter) {
  return axios({
    url: "/Room/GetRoomByID",
    method: "get",
    params: parameter,
  });
}
// 删除房间
export function deleteRoomByIds (parameter) {
  return axios({
    url: "/Room/DeleteByIds",
    method: "post",
    data: parameter,
  });
}
// 保存房间
export function saveRoom (parameter) {
  return axios({
    url: "/Room/SaveRoom",
    method: "post",
    data: parameter,
  });
}

/**
 * 根据根据楼幢号ID获取房间列表。
 *。buildingID
 */
export function GetRoomByBuildingID (parameter) {
  return axios({
    url: "/Room/GetRoomByBuildingID",
    method: "get",
    params: parameter,
  });
}

// 楼栋部分
// 获取楼栋列表
export function getBuildingList (parameter) {
  return axios({
    url: "/Building/GetList",
    method: "get",
    params: parameter,
  });
}
// 获取楼栋详情
export function getBuildingByID (parameter) {
  return axios({
    url: "/Building/GetBuildingByID",
    method: "get",
    params: parameter,
  });
}
// 删除房间
export function deleteBuildingByIds (parameter) {
  return axios({
    url: "/Building/DeleteByIds",
    method: "post",
    data: parameter,
  });
}
// 保存房间
export function saveBuilding (parameter) {
  return axios({
    url: "/Building/SaveBuilding",
    method: "post",
    data: parameter,
  });
}

/**
 * 根据小区ID获取楼幢和房间数据
 * residentialAreaID
 */
export function getBuildingAndRoomByResidentialAreaID (parameter) {
  return axios({
    url: "/Building/GetBuildingAndRoomByResidentialAreaID",
    method: "get",
    params: parameter,
  });
}
// 小区部分
// 获取小区列表
export function getResidentialAreaList (parameter) {
  return axios({
    url: "/ResidentialArea/GetList",
    method: "get",
    params: parameter,
  });
}
// 获取小区详情
export function getResidentialAreaByID (parameter) {
  return axios({
    url: "/ResidentialArea/GetResidentialAreaByID",
    method: "get",
    params: parameter,
  });
}
// 删除小区
export function deleteResidentialAreaByIds (parameter) {
  return axios({
    url: "/ResidentialArea/DeleteByIds",
    method: "post",
    data: parameter,
  });
}
// 保存小区
export function saveResidentialArea (parameter) {
  return axios({
    url: "/ResidentialArea/SaveResidentialArea",
    method: "post",
    data: parameter,
  });
}

/**
 * 获取小区汇总情况
 */
export function getSummarizeInformation (parameter) {
  return axios({
    url: "/ResidentialArea/GetSummarizeInformation",
    method: "get",
    params: parameter,
  });
}







// 保修列表
// 获取报修列表
export function getRepairList (parameter) {
  return axios({
    url: "/Repair/GetList",
    method: "get",
    params: parameter,
  });
}
// 获取报修详情
export function getRepairByID (parameter) {
  return axios({
    url: "/Repair/GetRepairByID",
    method: "get",
    params: parameter,
  });
}
// 获取报修详情
export function deleteRepairByIds (parameter) {
  return axios({
    url: "/Repair/DeleteByIds",
    method: "post",
    data: parameter,
  });
}





export function getCurMonthData (parameter) {
  return axios({
    url: "/Analysis/GetCurMonthData",
    method: "get",
    params: parameter,
  });
}
export function getConsultingByID (parameter) {
  return axios({
    url: "/Consulting/GetConsultingByID",
    method: "get",
    params: parameter,
  });
}
export function removeSupervisionObject (parameter) {
  return axios({
    url: "/SupervisionObject/RemoveSupervisionObject",
    method: "get",
    params: parameter,
  });
}

export function saveSupervisionObject (parameter) {
  return axios({
    url: `/SupervisionObject/SaveSupervisionObject`,
    method: "post",
    data: parameter,
  });
}

export function saveLawyerUser (parameter) {
  return axios({
    url: `/LawyerUser/SaveLawyerUser`,
    method: "post",
    data: parameter,
  });
}
export function delSupervisionObject (parameter) {
  return axios({
    url: `/SupervisionObject/DeleteByIds`,
    method: "post",
    data: parameter,
  });
}

export function getLawyerList (parameter) {
  return axios({
    url: "/Lawyer/GetList",
    method: "get",
    params: parameter,
  });
}
export function getLawyerByID (parameter) {
  return axios({
    url: "/Lawyer/GetLawyerByID",
    method: "get",
    params: parameter,
  });
}

export function saveLawyer (parameter) {
  return axios({
    url: `/Lawyer/SaveLawyer`,
    method: "post",
    data: parameter,
  });
}
export function deleteByIds (parameter) {
  return axios({
    url: `/Lawyer/DeleteByIds`,
    method: "post",
    data: parameter,
  });
}
export function getHelpList (parameter) {
  return axios({
    url: "/Help/GetList",
    method: "get",
    params: parameter,
  });
}
export function getHelpByID (parameter) {
  return axios({
    url: "/Help/GetHelpByID",
    method: "get",
    params: parameter,
  });
}

export function saveHelp (parameter) {
  return axios({
    url: `/Help/SaveHelp`,
    method: "post",
    data: parameter,
  });
}
export function delHelp (parameter) {
  return axios({
    url: `/Help/DeleteByIds`,
    method: "post",
    data: parameter,
  });
}

export function getEnterPriseList (parameter) {
  return axios({
    url: "/Enterprise/GetList",
    method: "get",
    params: parameter,
  });
}
export function getEnterpriseByID (parameter) {
  return axios({
    url: "/Enterprise/GetEnterpriseByID",
    method: "get",
    params: parameter,
  });
}

export function saveEnterprise (parameter) {
  return axios({
    url: `/Enterprise/SaveEnterprise`,
    method: "post",
    data: parameter,
  });
}
export function delEnterprise (parameter) {
  return axios({
    url: `/Enterprise/DeleteByIds`,
    method: "post",
    data: parameter,
  });
}

/** 通报列表 */
export function getNotificationList (parameter) {
  return axios({
    url: "/NotificationRecord/GetList",
    method: "get",
    params: parameter,
  });
}
export function getNotificationByID (parameter) {
  return axios({
    url: "/NotificationRecord/GetNotificationRecordByID",
    method: "get",
    params: parameter,
  });
}

export function saveNotification (parameter) {
  return axios({
    url: `/NotificationRecord/SaveNotificationRecord`,
    method: "post",
    data: parameter,
  });
}
export function delNotification (parameter) {
  return axios({
    url: `/NotificationRecord/DeleteByIds`,
    method: "post",
    data: parameter,
  });
}

/** 工作通知 */
export function getWorkNoticeList (parameter) {
  return axios({
    url: "/WorkNotice/GetList",
    method: "get",
    params: parameter,
  });
}
export function getWorkNoticeByID (parameter) {
  return axios({
    url: "/WorkNotice/GetWorkNoticeByID",
    method: "get",
    params: parameter,
  });
}

export function saveWorkNotice (parameter) {
  return axios({
    url: `/WorkNotice/SaveWorkNotice`,
    method: "post",
    data: parameter,
  });
}
export function delWorkNotice (parameter) {
  return axios({
    url: `/WorkNotice/DeleteByIds`,
    method: "post",
    data: parameter,
  });
}
// 导出
export function exportVisit (parameter) {
  return axios({
    url: `/Export/ExportVisitRecords`,
    method: "get",
    params: parameter,
  });
}
// 导出
export function getUserRoomList (parameter) {
  return axios({
    url: `/UserRoom/GetList`,
    method: "get",
    params: parameter,
  });
}
export function getModalUserList (parameter) {
  return axios({
    url: `/User/GetUserList`,
    method: "get",
    params: parameter,
  });
}
export function deleteUserRoomIds (parameter) {
  return axios({
    url: `/UserRoom/DeleteByIds`,
    method: "post",
    data: parameter,
  });
}
export function saveUserRooms (parameter) {
  return axios({
    url: `/UserRoom/SaveUserRooms`,
    method: "post",
    data: parameter,
  });
}
